package com.edisoncgh.controller;

import com.edisoncgh.pojo.Article;
import com.edisoncgh.pojo.BlogRoll;
import com.edisoncgh.service.BlogRollService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/linksOption")
public class LinkController {
    @Autowired
    private BlogRollService blogRollService;

    @RequestMapping("/allLinks")
    public String allLinks(Model model) {
        List<BlogRoll> list = blogRollService.findAll();
        model.addAttribute("linkList",list);
        for(BlogRoll blogRoll : list) {
            System.out.println(blogRoll);
        }
        return "backstage_links";
    }
}
